test: stfcEmailHandler function in a unit test - #1215
Conversation
Scott-James-Hurley
left a comment
There was a problem hiding this comment.
This looks great! Each test group only has one test in it, which seems a bit excessive. Maybe the mailservice tests could be moved into the one group.
| const mockMailService = { | ||
| sendMail: jest.fn(), | ||
| }; | ||
| //we should have a test email inbocx to recieve all the email instead of skipping it, for e2e testing and for better pathways |
There was a problem hiding this comment.
Would you mind writing an issue for this? If it's left as a code comment it may get forgotten about.
There was a problem hiding this comment.
I learnt that we do have a inbox that fills this purpose, I think we can get rid of this comment
| describe('mailService.sendMail is sucessful', () => { | ||
| it('When all required settings are valid', async () => { | ||
| // here instead of using a rng email, we instead set a magic variable for readability | ||
| // This test us |
There was a problem hiding this comment.
I don't follow this comment.
There was a problem hiding this comment.
It seems I didnt complete the comment, thank you for highlighting it
Do you mean to say , to put all the |
|
|
1 similar comment
|
|
2e34108 to
4c160cc
Compare
4c160cc to
3cd0f76
Compare
3cd0f76 to
8b5d0ba
Compare
Description
this pr it to close this issue - UserOfficeProject/issue-tracker#1439
Motivation and Context
Motivation is to add more testing to our UOC, this specifically was a unit test for the: /user-office-core/apps/backend/src/eventHandlers/email/stfcEmailHandler.ts
How Has This Been Tested
This has been tested talking typescript with the tool jest.
jest - https://jestjs.io/docs/expect
within jest.unit.config.js, in the testRegex atribute, set the path to point to the specific test file:
/user-office-core/apps/backend/src/eventHandlers/email/stfcEmailHandler.ts
Then in the user-office-core directory, in the terminal
npm run testThis can be viewed in:
/user-office-core/apps/backend/jest.unit.config.js